var express = require('express')
var router = express.Router()
var multer = require('multer')
var fs = require('fs')
var path = require('path')

const { addData } = require('../controllers/upload')
var upload = multer({ dest: path.join(__dirname, '../uploads') })

// 上传图片
router.post('/img', upload.single('file'), function (req, res, next) {
	addData(req, res)
})

module.exports = router
